
clear all
set mem 2000m
set maxvar 30000



clear all
insheet using "article_count.csv"

gen economist = strpos(v4, "Economist")/5
gen nyt = strpos(v4, "New")/5
gen washpost = strpos(v4,"Wash")/5


rename v1 country
rename v3 cha_count

egen hola = sieve(v2), keep(n)
destring hola, gen(hola2)



gen year = int(hola2/10000)


generate article=1

collapse (sum) article economist nyt washpost, by(year)

*country articles



twoway (line nyt economist washpost year, lwidth(thick thick thick) color(gs8 gs8 gs1) lpattern(solid dash_dot solid)) if year>1979, ///
ytitle("Number of articles") xlabel(1980(5)2015) xtitle("Year") legend( order(1 "New York Times" 2 "The Economist" 3 "Washington Post") size(small)) ///
plotregion(fcolor(white)) graphregion(fcolor(white))

graph export output/fig2.eps ,replace




